// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   AnioDescripcionPersistor.java

package org.fiel.persistence;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.fiel.commons.jdbc.Persistor;
import org.fiel.domain.AnioDescripcion;

public class AnioDescripcionPersistor extends Persistor
{

    public AnioDescripcionPersistor()
    {
    }

    protected String getTableNames()
    {
        return "informacion";
    }

    protected Object extract(ResultSet rs)
    {
        AnioDescripcion obj = new AnioDescripcion();
        try
        {
            obj.setAnio(rs.getString("anio"));
            obj.setDescripcion(rs.getString("descripcion"));
        }
        catch(SQLException e)
        {
            e.printStackTrace();
        }
        return obj;
    }

    protected List getOrderByFields()
    {
        List ls = new ArrayList();
        ls.add("anio");
        return ls;
    }

    protected List getFields()
    {
        List ls = new ArrayList();
        ls.add(" distinct(year(fechae))  as anio ");
        ls.add(" concat('A\361o ', year(fechae)) as descripcion ");
        return ls;
    }
}
